package tools;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;

public class BufferTools
{
	public static final int SIZE_FLOAT = 4;  // four bytes in a float
    public static FloatBuffer asFlippedFloatBuffer(float[] floatarray)
    {
        FloatBuffer fb = ByteBuffer.allocateDirect(floatarray.length * SIZE_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();
        fb.put(floatarray).flip();
        return fb;
    }
}
